<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Double-ended Queues</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GLib Reference Manual">
<link rel="up" href="glib-data-types.html" title="GLib Data Types">
<link rel="prev" href="glib-Singly-Linked-Lists.html" title="Singly-Linked Lists">
<link rel="next" href="glib-Sequences.html" title="Sequences">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="glib-Singly-Linked-Lists.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="glib-data-types.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GLib Reference Manual</th>
<td><a accesskey="n" href="glib-Sequences.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#glib-Double-ended-Queues.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#glib-Double-ended-Queues.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Double-ended Queues">
<a name="glib-Double-ended-Queues"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="glib-Double-ended-Queues.top_of_page"></a>Double-ended Queues</span></h2>
<p>Double-ended Queues — double-ended queue data structure</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="glib-Double-ended-Queues.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;glib.h&gt;

                    <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue">GQueue</a>;
<a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="returnvalue">GQueue</span></a>*             <a class="link" href="glib-Double-ended-Queues.html#g-queue-new" title="g_queue_new ()">g_queue_new</a>                         (<em class="parameter"><code><span class="type">void</span></code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-free" title="g_queue_free ()">g_queue_free</a>                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
#define             <a class="link" href="glib-Double-ended-Queues.html#G-QUEUE-INIT:CAPS" title="G_QUEUE_INIT">G_QUEUE_INIT</a>
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-init" title="g_queue_init ()">g_queue_init</a>                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-clear" title="g_queue_clear ()">g_queue_clear</a>                       (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="glib-Double-ended-Queues.html#g-queue-is-empty" title="g_queue_is_empty ()">g_queue_is_empty</a>                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a>               <a class="link" href="glib-Double-ended-Queues.html#g-queue-get-length" title="g_queue_get_length ()">g_queue_get_length</a>                  (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-reverse" title="g_queue_reverse ()">g_queue_reverse</a>                     (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="returnvalue">GQueue</span></a> *            <a class="link" href="glib-Double-ended-Queues.html#g-queue-copy" title="g_queue_copy ()">g_queue_copy</a>                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-foreach" title="g_queue_foreach ()">g_queue_foreach</a>                     (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GFunc" title="GFunc ()"><span class="type">GFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a> *             <a class="link" href="glib-Double-ended-Queues.html#g-queue-find" title="g_queue_find ()">g_queue_find</a>                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a> *             <a class="link" href="glib-Double-ended-Queues.html#g-queue-find-custom" title="g_queue_find_custom ()">g_queue_find_custom</a>                 (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareFunc" title="GCompareFunc ()"><span class="type">GCompareFunc</span></a> func</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-sort" title="g_queue_sort ()">g_queue_sort</a>                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> compare_func</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-head" title="g_queue_push_head ()">g_queue_push_head</a>                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-tail" title="g_queue_push_tail ()">g_queue_push_tail</a>                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-nth" title="g_queue_push_nth ()">g_queue_push_nth</a>                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> n</code></em>);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-head" title="g_queue_pop_head ()">g_queue_pop_head</a>                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-tail" title="g_queue_pop_tail ()">g_queue_pop_tail</a>                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-nth" title="g_queue_pop_nth ()">g_queue_pop_nth</a>                     (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="glib-Double-ended-Queues.html#g-queue-peek-head" title="g_queue_peek_head ()">g_queue_peek_head</a>                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="glib-Double-ended-Queues.html#g-queue-peek-tail" title="g_queue_peek_tail ()">g_queue_peek_tail</a>                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="glib-Double-ended-Queues.html#g-queue-peek-nth" title="g_queue_peek_nth ()">g_queue_peek_nth</a>                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);
<a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-index" title="g_queue_index ()">g_queue_index</a>                       (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-remove" title="g_queue_remove ()">g_queue_remove</a>                      (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-remove-all" title="g_queue_remove_all ()">g_queue_remove_all</a>                  (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-insert-before" title="g_queue_insert_before ()">g_queue_insert_before</a>               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *sibling</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-insert-after" title="g_queue_insert_after ()">g_queue_insert_after</a>                (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *sibling</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-insert-sorted" title="g_queue_insert_sorted ()">g_queue_insert_sorted</a>               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-head-link" title="g_queue_push_head_link ()">g_queue_push_head_link</a>              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-tail-link" title="g_queue_push_tail_link ()">g_queue_push_tail_link</a>              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-nth-link" title="g_queue_push_nth_link ()">g_queue_push_nth_link</a>               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> n</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-head-link" title="g_queue_pop_head_link ()">g_queue_pop_head_link</a>               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-tail-link" title="g_queue_pop_tail_link ()">g_queue_pop_tail_link</a>               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-nth-link" title="g_queue_pop_nth_link ()">g_queue_pop_nth_link</a>                (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="glib-Double-ended-Queues.html#g-queue-peek-head-link" title="g_queue_peek_head_link ()">g_queue_peek_head_link</a>              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="glib-Double-ended-Queues.html#g-queue-peek-tail-link" title="g_queue_peek_tail_link ()">g_queue_peek_tail_link</a>              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="glib-Double-ended-Queues.html#g-queue-peek-nth-link" title="g_queue_peek_nth_link ()">g_queue_peek_nth_link</a>               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);
<a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-link-index" title="g_queue_link_index ()">g_queue_link_index</a>                  (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-unlink" title="g_queue_unlink ()">g_queue_unlink</a>                      (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="glib-Double-ended-Queues.html#g-queue-delete-link" title="g_queue_delete_link ()">g_queue_delete_link</a>                 (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="glib-Double-ended-Queues.description"></a><h2>Description</h2>
<p>
The <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> structure and its associated functions provide a standard
queue data structure. Internally, <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> uses the same data structure as
<a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> to store elements.
</p>
<p>
The data contained in each element can be either integer values, by using one
of the
<a class="link" href="glib-Type-Conversion-Macros.html" title="Type Conversion Macros">Type Conversion Macros</a>,
or simply pointers to any type of data.
</p>
<p>
To create a new <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>, use <a class="link" href="glib-Double-ended-Queues.html#g-queue-new" title="g_queue_new ()"><code class="function">g_queue_new()</code></a>.
</p>
<p>
To initialize a statically-allocated <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>, use <a class="link" href="glib-Double-ended-Queues.html#G-QUEUE-INIT:CAPS" title="G_QUEUE_INIT"><span class="type">G_QUEUE_INIT</span></a> or
<a class="link" href="glib-Double-ended-Queues.html#g-queue-init" title="g_queue_init ()"><code class="function">g_queue_init()</code></a>.
</p>
<p>
To add elements, use <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-head" title="g_queue_push_head ()"><code class="function">g_queue_push_head()</code></a>, <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-head-link" title="g_queue_push_head_link ()"><code class="function">g_queue_push_head_link()</code></a>,
<a class="link" href="glib-Double-ended-Queues.html#g-queue-push-tail" title="g_queue_push_tail ()"><code class="function">g_queue_push_tail()</code></a> and <a class="link" href="glib-Double-ended-Queues.html#g-queue-push-tail-link" title="g_queue_push_tail_link ()"><code class="function">g_queue_push_tail_link()</code></a>.
</p>
<p>
To remove elements, use <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-head" title="g_queue_pop_head ()"><code class="function">g_queue_pop_head()</code></a> and <a class="link" href="glib-Double-ended-Queues.html#g-queue-pop-tail" title="g_queue_pop_tail ()"><code class="function">g_queue_pop_tail()</code></a>.
</p>
<p>
To free the entire queue, use <a class="link" href="glib-Double-ended-Queues.html#g-queue-free" title="g_queue_free ()"><code class="function">g_queue_free()</code></a>.
</p>
</div>
<div class="refsect1" title="Details">
<a name="glib-Double-ended-Queues.details"></a><h2>Details</h2>
<div class="refsect2" title="GQueue">
<a name="GQueue"></a><h3>GQueue</h3>
<pre class="programlisting">typedef struct {
  GList *head;
  GList *tail;
  guint  length;
} GQueue;
</pre>
<p>
Contains the public fields of a Queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *<em class="structfield"><code><a name="GQueue.head"></a>head</code></em>;</span></p></td>
<td>a pointer to the first element of the queue.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *<em class="structfield"><code><a name="GQueue.tail"></a>tail</code></em>;</span></p></td>
<td>a pointer to the last element of the queue.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> <em class="structfield"><code><a name="GQueue.length"></a>length</code></em>;</span></p></td>
<td>the number of elements in the queue.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_new ()">
<a name="g-queue-new"></a><h3>g_queue_new ()</h3>
<pre class="programlisting"><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="returnvalue">GQueue</span></a>*             g_queue_new                         (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Creates a new <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a new <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_free ()">
<a name="g-queue-free"></a><h3>g_queue_free ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_free                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Frees the memory allocated for the <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>. Only call this function if
<em class="parameter"><code>queue</code></em> was created with <a class="link" href="glib-Double-ended-Queues.html#g-queue-new" title="g_queue_new ()"><code class="function">g_queue_new()</code></a>. If queue elements contain
dynamically-allocated memory, they should be freed first.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="G_QUEUE_INIT">
<a name="G-QUEUE-INIT:CAPS"></a><h3>G_QUEUE_INIT</h3>
<pre class="programlisting">#define G_QUEUE_INIT { NULL, NULL, 0 }
</pre>
<p>
A statically-allocated <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> must be initialized with this macro before it
can be used.  This macro can be used to initialize a variable, but it cannot
be assigned to a variable.  In that case you have to use <a class="link" href="glib-Double-ended-Queues.html#g-queue-init" title="g_queue_init ()"><code class="function">g_queue_init()</code></a>.
</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="usertype">GQueue</span><span class="normal"> my_queue </span><span class="symbol">=</span><span class="normal"> <a href="glib-Double-ended-Queues.html#G-QUEUE-INIT:CAPS">G_QUEUE_INIT</a></span><span class="symbol">;</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2" title="g_queue_init ()">
<a name="g-queue-init"></a><h3>g_queue_init ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_init                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
A statically-allocated <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> must be initialized with this function
before it can be used. Alternatively you can initialize it with
<a class="link" href="glib-Double-ended-Queues.html#G-QUEUE-INIT:CAPS" title="G_QUEUE_INIT"><span class="type">G_QUEUE_INIT</span></a>. It is not necessary to initialize queues created with
<a class="link" href="glib-Double-ended-Queues.html#g-queue-new" title="g_queue_new ()"><code class="function">g_queue_new()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>an uninitialized <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2" title="g_queue_clear ()">
<a name="g-queue-clear"></a><h3>g_queue_clear ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_clear                       (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Removes all the elements in <em class="parameter"><code>queue</code></em>. If queue elements contain
dynamically-allocated memory, they should be freed first.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2" title="g_queue_is_empty ()">
<a name="g-queue-is-empty"></a><h3>g_queue_is_empty ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gboolean" title="gboolean"><span class="returnvalue">gboolean</span></a>            g_queue_is_empty                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Returns <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the queue is empty.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> <a class="link" href="glib-Standard-Macros.html#TRUE:CAPS" title="TRUE"><code class="literal">TRUE</code></a> if the queue is empty.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_get_length ()">
<a name="g-queue-get-length"></a><h3>g_queue_get_length ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="returnvalue">guint</span></a>               g_queue_get_length                  (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Returns the number of items in <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The number of items in <em class="parameter"><code>queue</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_reverse ()">
<a name="g-queue-reverse"></a><h3>g_queue_reverse ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_reverse                     (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Reverses the order of the items in <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_copy ()">
<a name="g-queue-copy"></a><h3>g_queue_copy ()</h3>
<pre class="programlisting"><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="returnvalue">GQueue</span></a> *            g_queue_copy                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Copies a <em class="parameter"><code>queue</code></em>. Note that is a shallow copy. If the elements in the
queue consist of pointers to data, the pointers are copied, but the
actual data is not.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A copy of <em class="parameter"><code>queue</code></em>

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_foreach ()">
<a name="g-queue-foreach"></a><h3>g_queue_foreach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_foreach                     (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GFunc" title="GFunc ()"><span class="type">GFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Calls <em class="parameter"><code>func</code></em> for each element in the queue passing <em class="parameter"><code>user_data</code></em> to the
function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the function to call for each element's data
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data to pass to <em class="parameter"><code>func</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_find ()">
<a name="g-queue-find"></a><h3>g_queue_find ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a> *             g_queue_find                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);</pre>
<p>
Finds the first link in <em class="parameter"><code>queue</code></em> which contains <em class="parameter"><code>data</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to find
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The first link in <em class="parameter"><code>queue</code></em> which contains <em class="parameter"><code>data</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_find_custom ()">
<a name="g-queue-find-custom"></a><h3>g_queue_find_custom ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a> *             g_queue_find_custom                 (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareFunc" title="GCompareFunc ()"><span class="type">GCompareFunc</span></a> func</code></em>);</pre>
<p>
Finds an element in a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>, using a supplied function to find the
desired element. It iterates over the queue, calling the given function
which should return 0 when the desired element is found. The function
takes two gconstpointer arguments, the <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> element's data as the
first argument and the given user data as the second argument.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>func</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareFunc" title="GCompareFunc ()"><span class="type">GCompareFunc</span></a> to call for each element. It should return 0
when the desired element is found
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The found link, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if it wasn't found

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_sort ()">
<a name="g-queue-sort"></a><h3>g_queue_sort ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_sort                        (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> compare_func</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Sorts <em class="parameter"><code>queue</code></em> using <em class="parameter"><code>compare_func</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>compare_func</code></em> :</span></p></td>
<td>the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> used to sort <em class="parameter"><code>queue</code></em>. This function
    is passed two elements of the queue and should return 0 if they are
    equal, a negative value if the first comes before the second, and
    a positive value if the second comes before the first.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>compare_func</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_push_head ()">
<a name="g-queue-push-head"></a><h3>g_queue_push_head ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_push_head                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Adds a new element at the head of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new element.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_push_tail ()">
<a name="g-queue-push-tail"></a><h3>g_queue_push_tail ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_push_tail                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Adds a new element at the tail of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new element.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_push_nth ()">
<a name="g-queue-push-nth"></a><h3>g_queue_push_nth ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_push_nth                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> n</code></em>);</pre>
<p>
Inserts a new element into <em class="parameter"><code>queue</code></em> at the given position
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data for the new element
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>the position to insert the new element. If <em class="parameter"><code>n</code></em> is negative or
    larger than the number of elements in the <em class="parameter"><code>queue</code></em>, the element is
    added to the end of the queue.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_pop_head ()">
<a name="g-queue-pop-head"></a><h3>g_queue_pop_head ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            g_queue_pop_head                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Removes the first element of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the data of the first element in the queue, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the queue
  is empty.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_pop_tail ()">
<a name="g-queue-pop-tail"></a><h3>g_queue_pop_tail ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            g_queue_pop_tail                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Removes the last element of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the data of the last element in the queue, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the queue
  is empty.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_pop_nth ()">
<a name="g-queue-pop-nth"></a><h3>g_queue_pop_nth ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            g_queue_pop_nth                     (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>
Removes the <em class="parameter"><code>n</code></em>'th element of <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>the position of the element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the element's data, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>n</code></em> is off the end of <em class="parameter"><code>queue</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_peek_head ()">
<a name="g-queue-peek-head"></a><h3>g_queue_peek_head ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            g_queue_peek_head                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Returns the first element of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the data of the first element in the queue, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the queue
  is empty.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_peek_tail ()">
<a name="g-queue-peek-tail"></a><h3>g_queue_peek_tail ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            g_queue_peek_tail                   (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Returns the last element of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the data of the last element in the queue, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the queue
  is empty.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_peek_nth ()">
<a name="g-queue-peek-nth"></a><h3>g_queue_peek_nth ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="returnvalue">gpointer</span></a>            g_queue_peek_nth                    (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>
Returns the <em class="parameter"><code>n</code></em>'th element of <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>the position of the element.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The data for the <em class="parameter"><code>n</code></em>'th element of <em class="parameter"><code>queue</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>n</code></em> is
  off the end of <em class="parameter"><code>queue</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_index ()">
<a name="g-queue-index"></a><h3>g_queue_index ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                g_queue_index                       (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);</pre>
<p>
Returns the position of the first element in <em class="parameter"><code>queue</code></em> which contains <em class="parameter"><code>data</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data to find.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The position of the first element in <em class="parameter"><code>queue</code></em> which contains <em class="parameter"><code>data</code></em>, or -1 if no element in <em class="parameter"><code>queue</code></em> contains <em class="parameter"><code>data</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_remove ()">
<a name="g-queue-remove"></a><h3>g_queue_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_remove                      (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);</pre>
<p>
Removes the first element in <em class="parameter"><code>queue</code></em> that contains <em class="parameter"><code>data</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to remove.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_remove_all ()">
<a name="g-queue-remove-all"></a><h3>g_queue_remove_all ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_remove_all                  (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gconstpointer" title="gconstpointer"><span class="type">gconstpointer</span></a> data</code></em>);</pre>
<p>
Remove all elemeents in <em class="parameter"><code>queue</code></em> which contains <em class="parameter"><code>data</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>data to remove
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_insert_before ()">
<a name="g-queue-insert-before"></a><h3>g_queue_insert_before ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_insert_before               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *sibling</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Inserts <em class="parameter"><code>data</code></em> into <em class="parameter"><code>queue</code></em> before <em class="parameter"><code>sibling</code></em>.
</p>
<p>
<em class="parameter"><code>sibling</code></em> must be part of <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> link that <span class="emphasis"><em>must</em></span> be part of <em class="parameter"><code>queue</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data to insert
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_insert_after ()">
<a name="g-queue-insert-after"></a><h3>g_queue_insert_after ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_insert_after                (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *sibling</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
Inserts <em class="parameter"><code>data</code></em> into <em class="parameter"><code>queue</code></em> after <em class="parameter"><code>sibling</code></em>
</p>
<p>
<em class="parameter"><code>sibling</code></em> must be part of <em class="parameter"><code>queue</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sibling</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> link that <span class="emphasis"><em>must</em></span> be part of <em class="parameter"><code>queue</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data to insert
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_insert_sorted ()">
<a name="g-queue-insert-sorted"></a><h3>g_queue_insert_sorted ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_insert_sorted               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gpointer" title="gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Inserts <em class="parameter"><code>data</code></em> into <em class="parameter"><code>queue</code></em> using <em class="parameter"><code>func</code></em> to determine the new position.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the data to insert
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the <a class="link" href="glib-Doubly-Linked-Lists.html#GCompareDataFunc" title="GCompareDataFunc ()"><span class="type">GCompareDataFunc</span></a> used to compare elements in the queue. It is
    called with two elements of the <em class="parameter"><code>queue</code></em> and <em class="parameter"><code>user_data</code></em>. It should
    return 0 if the elements are equal, a negative value if the first
    element comes before the second, and a positive value if the second
    element comes before the first.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>user data passed to <em class="parameter"><code>func</code></em>.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_push_head_link ()">
<a name="g-queue-push-head-link"></a><h3>g_queue_push_head_link ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_push_head_link              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);</pre>
<p>
Adds a new element at the head of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>link_</code></em> :</span></p></td>
<td>a single <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> element, <span class="emphasis"><em>not</em></span> a list with
    more than one element.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_push_tail_link ()">
<a name="g-queue-push-tail-link"></a><h3>g_queue_push_tail_link ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_push_tail_link              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);</pre>
<p>
Adds a new element at the tail of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>link_</code></em> :</span></p></td>
<td>a single <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> element, <span class="emphasis"><em>not</em></span> a list with
  more than one element.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_push_nth_link ()">
<a name="g-queue-push-nth-link"></a><h3>g_queue_push_nth_link ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_push_nth_link               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a> n</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);</pre>
<p>
Inserts <em class="parameter"><code>link</code></em> into <em class="parameter"><code>queue</code></em> at the given position.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>the position to insert the link. If this is negative or larger than
    the number of elements in <em class="parameter"><code>queue</code></em>, the link is added to the end of
    <em class="parameter"><code>queue</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>link_</code></em> :</span></p></td>
<td>the link to add to <em class="parameter"><code>queue</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_pop_head_link ()">
<a name="g-queue-pop-head-link"></a><h3>g_queue_pop_head_link ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              g_queue_pop_head_link               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Removes the first element of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> element at the head of the queue, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the queue
  is empty.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_pop_tail_link ()">
<a name="g-queue-pop-tail-link"></a><h3>g_queue_pop_tail_link ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              g_queue_pop_tail_link               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Removes the last element of the queue.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> element at the tail of the queue, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if the queue
  is empty.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="g_queue_pop_nth_link ()">
<a name="g-queue-pop-nth-link"></a><h3>g_queue_pop_nth_link ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              g_queue_pop_nth_link                (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>
Removes and returns the link at the given position.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>the link's position
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The <em class="parameter"><code>n</code></em>'th link, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>n</code></em> is off the end of <em class="parameter"><code>queue</code></em>.

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_peek_head_link ()">
<a name="g-queue-peek-head-link"></a><h3>g_queue_peek_head_link ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              g_queue_peek_head_link              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Returns the first link in <em class="parameter"><code>queue</code></em>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the first link in <em class="parameter"><code>queue</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>queue</code></em> is empty

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_peek_tail_link ()">
<a name="g-queue-peek-tail-link"></a><h3>g_queue_peek_tail_link ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              g_queue_peek_tail_link              (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>);</pre>
<p>
Returns the last link <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the last link in <em class="parameter"><code>queue</code></em>, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>queue</code></em> is empty

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_peek_nth_link ()">
<a name="g-queue-peek-nth-link"></a><h3>g_queue_peek_nth_link ()</h3>
<pre class="programlisting"><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="returnvalue">GList</span></a>*              g_queue_peek_nth_link               (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>
Returns the link at the given position
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>the position of the link
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The link at the <em class="parameter"><code>n</code></em>'th position, or <a class="link" href="glib-Standard-Macros.html#NULL:CAPS" title="NULL"><code class="literal">NULL</code></a> if <em class="parameter"><code>n</code></em> is off the
end of the list

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_link_index ()">
<a name="g-queue-link-index"></a><h3>g_queue_link_index ()</h3>
<pre class="programlisting"><a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="returnvalue">gint</span></a>                g_queue_link_index                  (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);</pre>
<p>
Returns the position of <em class="parameter"><code>link_</code></em> in <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <span class="type">Gqueue</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>link_</code></em> :</span></p></td>
<td>A <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> link
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The position of <em class="parameter"><code>link_</code></em>, or -1 if the link is
not part of <em class="parameter"><code>queue</code></em>

</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_unlink ()">
<a name="g-queue-unlink"></a><h3>g_queue_unlink ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_unlink                      (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);</pre>
<p>
Unlinks <em class="parameter"><code>link_</code></em> so that it will no longer be part of <em class="parameter"><code>queue</code></em>. The link is
not freed.
</p>
<p>
<em class="parameter"><code>link_</code></em> must be part of <em class="parameter"><code>queue</code></em>,
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>link_</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> link that <span class="emphasis"><em>must</em></span> be part of <em class="parameter"><code>queue</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2" title="g_queue_delete_link ()">
<a name="g-queue-delete-link"></a><h3>g_queue_delete_link ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_queue_delete_link                 (<em class="parameter"><code><a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a> *queue</code></em>,
                                                         <em class="parameter"><code><a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> *link_</code></em>);</pre>
<p>
Removes <em class="parameter"><code>link_</code></em> from <em class="parameter"><code>queue</code></em> and frees it.
</p>
<p>
<em class="parameter"><code>link_</code></em> must be part of <em class="parameter"><code>queue</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>queue</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Double-ended-Queues.html#GQueue" title="GQueue"><span class="type">GQueue</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>link_</code></em> :</span></p></td>
<td>a <a class="link" href="glib-Doubly-Linked-Lists.html#GList" title="GList"><span class="type">GList</span></a> link that <span class="emphasis"><em>must</em></span> be part of <em class="parameter"><code>queue</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>